#include "tcp_server.hpp"

void usage(const std::string& proc)
{
    std::cout << "Usage:\n\t" << proc << " port\n" << std::endl;
}

std::string echo(const std::string& msg)
{
    return msg;
}

int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        usage(argv[0]);
        exit(CMD_ERR);
    }
    uint16_t port = std::stoi(argv[1]);

    std::unique_ptr<tcp::tcp_server> tsvr(new tcp::tcp_server(echo, port));
    tsvr->init();
    tsvr->start();

    return 0;
}

